home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18551 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  766 b 

  1. Path: news.dorsai.org!not-for-mail
  2. From: mongoose@dorsai.org (Jeff Yu)
  3. Newsgroups: comp.lang.c++
  4. Subject: How to read: operator overloaded <<
  5. Date: 21 Apr 1996 10:13:00 -0400
  6. Organization: The Dorsai Embassy, Inc.
  7. Message-ID: <4ldfpc$j0u@amanda.dorsai.org>
  8. NNTP-Posting-Host: amanda.dorsai.org
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi, I have hard time to understand the syntac of << operator overloaded 
  12. declaration. As it is stated in Lippman's C++ Primer, the << sample is
  13. supposed to take TWO parameters: ostream& operator<<(ostream& os, String& s)
  14. But when using it, the way is: cout<<"test"<<MyScreen<<endl;
  15. Where is the second parameter if I consider the MyScreen as the first one?
  16.  
  17. What is the difference from ostream& operator << (String &s)?
  18.  
  19. Please help!
  20.  
  21.